import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Main {

	public static void main(String [] args){
		Bank bank = new Bank();
		
		ExecutorService executor = Executors.newFixedThreadPool(100);
		for(int i = 0; i < 100 ;i++){
			executor.execute(new Consumer(bank));
		}
		
		executor.shutdown();
		
		while(!executor.isTerminated()){
			
		}
		
		System.out.println("Result : " + bank.getCash());
	}
}
